package cn.ljh.controller;

import cn.ljh.service.HelloService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/demo")
public class HelloController {

    @Reference
    private HelloService helloService;

    @RequestMapping("/hello.do")
    @ResponseBody
    public String sayHello(@RequestParam(name = "name") String name){
        //远程调用
         return helloService.sayHello(name);
    }
}
